package org.example.gateway.transfer;

import org.example.gateway.bean.App;
import org.example.gateway.pojo.vo.AppVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface AppVoTransfer {
    AppVoTransfer INSTANCE = Mappers.getMapper(AppVoTransfer.class);

    @Mappings({
            @Mapping(target = "createdTime", expression = "java(org.example.gateway.utils.DateUtil.formatDate(app.getCreatedTime()))")
    })
    AppVo mapToVo(App app);

    List<AppVo> mapToVOList(List<App> appList);
}
